package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TT_DOCU_TRANS database table.
 * 
 */
@Embeddable
public class TtDocuTranPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String coRegiPres;
	private String aaHojaPres;
	private String coOficRgstPres;
	private String nuHojaPres;
	private String nsDocuTrans;

    public TtDocuTranPK() {
    }

	@Column(name="CO_REGI_PRES", unique=true, nullable=false, length=2)
	public String getCoRegiPres() {
		return this.coRegiPres;
	}
	public void setCoRegiPres(String coRegiPres) {
		this.coRegiPres = coRegiPres;
	}

	@Column(name="AA_HOJA_PRES", unique=true, nullable=false, length=4)
	public String getAaHojaPres() {
		return this.aaHojaPres;
	}
	public void setAaHojaPres(String aaHojaPres) {
		this.aaHojaPres = aaHojaPres;
	}

	@Column(name="CO_OFIC_RGST_PRES", unique=true, nullable=false, length=2)
	public String getCoOficRgstPres() {
		return this.coOficRgstPres;
	}
	public void setCoOficRgstPres(String coOficRgstPres) {
		this.coOficRgstPres = coOficRgstPres;
	}

	@Column(name="NU_HOJA_PRES", unique=true, nullable=false, length=8)
	public String getNuHojaPres() {
		return this.nuHojaPres;
	}
	public void setNuHojaPres(String nuHojaPres) {
		this.nuHojaPres = nuHojaPres;
	}

	@Column(name="NS_DOCU_TRANS", unique=true, nullable=false, length=3)
	public String getNsDocuTrans() {
		return this.nsDocuTrans;
	}
	public void setNsDocuTrans(String nsDocuTrans) {
		this.nsDocuTrans = nsDocuTrans;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TtDocuTranPK)) {
			return false;
		}
		TtDocuTranPK castOther = (TtDocuTranPK)other;
		return 
			this.coRegiPres.equals(castOther.coRegiPres)
			&& this.aaHojaPres.equals(castOther.aaHojaPres)
			&& this.coOficRgstPres.equals(castOther.coOficRgstPres)
			&& this.nuHojaPres.equals(castOther.nuHojaPres)
			&& this.nsDocuTrans.equals(castOther.nsDocuTrans);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.coRegiPres.hashCode();
		hash = hash * prime + this.aaHojaPres.hashCode();
		hash = hash * prime + this.coOficRgstPres.hashCode();
		hash = hash * prime + this.nuHojaPres.hashCode();
		hash = hash * prime + this.nsDocuTrans.hashCode();
		
		return hash;
    }
}